/**
 * Created by Elsa on 2017/9/5.
 */

layui.define(['form', 'layedit', 'laydate','jquery'], function(exports){
    var form = layui.form(),
        $ = layui.jquery,
        layer = layui.layer,
        layedit = layui.layedit,
        laydate = layui.laydate;

    var docnum = getQueryString("inspnum");
    console.log(docnum);

    form.render();

    //监听提交
//     form.on('submit(caseglyx)', function(data) {
//         var ConstNewDocList = new Object();
//         ConstNewDocList.docnum = docnum;
//         ConstNewDocList.docname = data.field.docname;
//         ConstNewDocList.uploader = data.field.uploader;
//         ConstNewDocList.doc = "address";
//
//         console.log(JSON.stringify(ConstNewDocList));
//
//         $.ajax({
//             type:"POST",
//             url:contextPath+"/project/const/doc/new",
//             contentType: "application/json; charset=utf-8",
//             data:JSON.stringify(ConstNewDocList),
//             dataType:"json",
//             success:function (data) {
//                 console.log(data.message);
//                 if(data.message == "文档新建成功!"){
//                     alert(data.message );
//                     // layer.closeAll();
//                     layer.msg('文档新建成功!<br>页面将在3秒后刷新...');
//                     setTimeout(function(){window.location.reload();},3000);
//                 } else {
//                     alert(data.message );
//                 }
//             },
//             error:function (e) {
// //                                console.log(e+'error');
//             }
//         });
//         return false;
//     });

    exports('ConstNewDocList', {}); //注意，这里是模块输出的核心，模块名必须和use时的模块名一致
});